<template>
  <div id="ev-message">
    <div class="title-img">
      <van-image width="32" height="32" fit="cover" src="https://img.yzcdn.cn/vant/cat.jpeg" />
    </div>
    <div class="message-content">
      <div class="top">
        <h3>{{values.username}}</h3>
        <span>{{values.rated_at}}</span>
      </div>

      <div class="imgs">
        <van-rate v-model="values.rating_star" :allow-half="true" readonly />
        <span>{{values.time_spent_desc}}</span>
      </div>
      <div class="msg-img">
        <van-image
          width="65"
          height="65"
          v-for="item in values.item_ratings"
          :src="item.image_hash ? (pre + item.image_hash).substring(0,(pre + item.image_hash).lastIndexOf('jpeg')) + '.jpeg': ''"
          :key="item.food_id"
        />
      </div>
      <div class="food-name-list">
        <van-tag plain v-for="item in values.item_ratings" color="" :key="item.food_id">{{item.food_name}}</van-tag>
      </div>
      <!-- <div class="msg-left">
              
              <div class="msg-rate">
                  <van-rate v-model="values.rating_star" :allow-half='true' readonly /> <span>{{values.time_spent_desc}}</span>
              </div>
              <div class="msg-img">
                  <van-image width="100" height="100" v-for="item in values.item_ratings" :src="item.image_hash" :key="item.food_id" />
              </div>
          </div>
      <div class="meg-right"></div>-->
    </div>
  </div>
</template>

<script>
export default {
  props: {
    values: {
      type: Object,
      default: () => {
        return {};
      }
    }
  },
  data() {
    return {
      pre: "http://kumanxuan1.f3322.net:8001/img/"
    };
  },
  mounted() {
    console.log(this.values);
  }
};
</script>

<style lang="less">
#ev-message {
  background-color: #ffffff;
  display: flex;
  flex-direction: row;
  justify-content: flex-start;

  .title-img {
    padding: 30px;
  }

  .message-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding-top: 30px;
    padding-right: 30px;
    color: #898989;

    .top {
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      align-items: flex-start;
    }

    .imgs {
      padding-top: 10px;
      span {
        margin-left: 20px;
      }
    }

    .msg-img {
      display: flex;
      flex-direction: row;
      justify-content: flex-start;
      flex-wrap: wrap;
      .van-image {
        margin-top: 20px;
        margin-right: 20px;
      }
    }

    .food-name-list{
        .van-tag{
            margin-right: 10px;
            margin-top: 10px;
        }
    }

    /* .msg-left{
                .msg-rate{
                    
                }
                .msg-img{
                    
                }
            }

            .meg-right{
                padding:0 30px 30px 30px;
            } */
  }
}
</style>